package com.runoob.gzip;

import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.zip.GZIPOutputStream;

public class Test3 {
    public static void main(String[] args) throws IOException {
        String path1="d:/MYSQL2.xml";
        String path2="d:/MYSQL2.xml.gz";
        compressFileToGzip(path1,path2);
    }

    public static void compressFileToGzip(String source, String target) throws IOException {
        try (FileOutputStream fos = new FileOutputStream(target);
             GZIPOutputStream gzipOS = new GZIPOutputStream(fos)) {
//            Files.copy(Path.of(source), gzipOS);
        }
    }


}
